-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 10 Cze 2014, 18:05
-- Server version: 5.6.16
-- PHP Version: 5.5.11

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `downloadmanager`
--

-- --------------------------------------------------------

--
-- Struktura tabeli dla tabeli `files`
--

CREATE TABLE IF NOT EXISTS `files` (
  `id_file` int(6) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `downloads` int(6) NOT NULL,
  `user_id` int(6) NOT NULL,
  `description` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `uwagi` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `link` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_file`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ;

--
-- Zrzut danych tabeli `files`
--

INSERT INTO `files` (`id_file`, `name`, `date`, `downloads`, `user_id`, `description`, `uwagi`, `link`) VALUES
(1, 'jakiplik', '2014-05-27', 5, 1, 'fdgdfgdfg', NULL, 'pliki/tekst.docx'),
(5, 'Sciaga', '2014-05-27', 23, 3, 'hgfhgfh', NULL, 'pliki/Bartecki_calosc_popr.pdf'),
(9, 'dfgdg', '2014-05-30', 6, 2, 'fhfh', NULL, 'pliki/gry.sql'),
(13, '4 program', '2014-06-09', 6, 1, '4 program', NULL, 'pliki/4_analiza_sygnalu2.zip'),
(14, 'praca', '2014-06-10', 0, 1, 'praca przejściowa marcina', 'w środku prezentacja', 'pliki/Marcin_Szymainda-praca_przejsciowa2.rar');

-- --------------------------------------------------------

--
-- Struktura tabeli dla tabeli `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(6) NOT NULL,
  `username` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `privileges` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Zrzut danych tabeli `users`
--

INSERT INTO `users` (`id`, `username`, `privileges`) VALUES
(1, 'Admin', 1),
(2, 'Paweł', 2),
(3, 'Marcin', 2);

--
-- Ograniczenia dla zrzutów tabel
--

--
-- Ograniczenia dla tabeli `files`
--
ALTER TABLE `files`
  ADD CONSTRAINT `fk_userid` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
